package com.tedu.bill;

import java.util.Scanner;

/**
 * Author：毕龙
 * Date: 2024/3/21 20:22
 */
public class TestBankLoginSystem {
    public static void main(String[] args) {
        //银行ATM取款机
        System.out.println("******************************************");
        System.out.println("***********欢迎来带建设引号ATM取款机********");
        System.out.println("******************************************");
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入用户名：");
        String username = sc.next();
        System.out.println("请输入密码：");
        String password = sc.next();
        if (username.equals("朱琳")) {
            if (password.equals("123456")) {
                System.out.println("******************************************");
                System.out.println("***********       欢迎:" + username + "     ********");
                System.out.println("******************************************");
                System.out.println("1.修改密码  2.存款  3.取款  4.转账  5.退出");
                System.out.println("请输入您的选择：");
                int select = sc.nextInt();
                switch (select) {
                    case 1:
                        System.out.println("请输入原密码：");
                        String oldPass = sc.next();
                        if(password.equals(oldPass)){
                            System.out.println("请输入新密码：");
                            String newPass = sc.next();
                            System.out.println("请再次输入新密码：");
                            String surePass = sc.next();
                            if(newPass.equals(surePass)){
                                System.out.println("修改密码成功！");
                            }else{
                                System.out.println("两次输入密码不一致，修改密码失败！！");
                            }
                        }else{
                            System.out.println("原密码不正确！！！");
                        }
                        break;
                    case 2:
                        System.out.println("存款成功！");
                        break;
                    case 3:
                        System.out.println("取款成功！");
                        break;
                    case 4:
                        System.out.println("转账成功！");
                        break;
                    case 5:
                        //退出
                        System.exit(0);
                        break;
                    default:
                        System.out.println("选择错误！！！");
                }
            } else {
                System.out.println("密码错误");
            }
        } else {
            System.out.println("用户错误！！");
        }
    }
}
